﻿<%@ WebHandler Language="C#" Class="Handler" %>

using System;
using System.Web;

public class Handler : System.Web.IHttpAsyncHandler {

    cn.com.webxml.webservice.qqOnlineWebService service
       = new cn.com.webxml.webservice.qqOnlineWebService();
    
    public IAsyncResult BeginProcessRequest(
        HttpContext context,
        AsyncCallback cb,
        object extraData)
    {
        return service.BeginqqCheckOnline("123456", cb, context);
    }

    public void EndProcessRequest(IAsyncResult result)
    {
        string code = service.EndqqCheckOnline(result);
        HttpContext context = result.AsyncState as HttpContext;

        string status = QQOnlineHelper.GetOnlineStatus(code);
        context.Response.Output.WriteLine(status);
    }

 
    public bool IsReusable {
        get {
            return false;
        }
    }


    #region IHttpHandler Members


    public void ProcessRequest(HttpContext context)
    {
        throw new NotImplementedException();
    }

    #endregion
}